home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / lib / perl5 / Glib.pm < prev    next >
Text File  |  2009-03-29  |  23KB  |  674 lines

  1. # Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for
  2. # the full list)
  3. #
  4. # This library is free software; you can redistribute it and/or modify it under
  5. # the terms of the GNU Library General Public License as published by the Free
  6. # Software Foundation; either version 2.1 of the License, or (at your option)
  7. # any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful, but WITHOUT
  10. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. # FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
  12. # more details.
  13. #
  14. # You should have received a copy of the GNU Library General Public License
  15. # along with this library; if not, write to the Free Software Foundation, Inc.,
  16. # 59 Temple Place - Suite 330, Boston, MA  02111-1307  USA.
  17. #
  18. # $Id: Glib.pm 1117 2009-03-29 14:35:14Z tsch $
  19. #
  20.  
  21. package Glib;
  22.  
  23. use 5.008;
  24. use strict;
  25. use warnings;
  26. use Exporter;
  27. require DynaLoader;
  28. our @ISA = qw(DynaLoader Exporter);
  29.  
  30. use constant {
  31.     TRUE  => 1,
  32.     FALSE => !1, # can't use !TRUE at this point
  33.     G_PRIORITY_HIGH         => -100,
  34.     G_PRIORITY_DEFAULT      =>  0,
  35.     G_PRIORITY_HIGH_IDLE    =>  100,
  36.     G_PRIORITY_DEFAULT_IDLE =>  200,
  37.     G_PRIORITY_LOW            =>  300,
  38.     G_PARAM_READWRITE       => [qw/readable writable/],
  39.  
  40.     SOURCE_CONTINUE         => 1,
  41.     SOURCE_REMOVE           => !1,
  42. };
  43.  
  44. # export nothing by default.
  45. # export functions and constants by request.
  46. our %EXPORT_TAGS = (
  47.     constants => [qw/
  48.             TRUE
  49.             FALSE
  50.             G_PRIORITY_HIGH
  51.             G_PRIORITY_DEFAULT
  52.             G_PRIORITY_HIGH_IDLE
  53.             G_PRIORITY_DEFAULT_IDLE
  54.             G_PRIORITY_LOW
  55.             G_PARAM_READWRITE
  56.             /],
  57.     functions => [qw/
  58.             filename_to_unicode
  59.             filename_from_unicode
  60.             filename_to_uri
  61.             filename_from_uri
  62.             filename_display_name
  63.             filename_display_basename
  64.             /],
  65. );
  66. our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
  67. $EXPORT_TAGS{all} = \@EXPORT_OK;
  68.  
  69. our $VERSION = '1.221';
  70.  
  71. sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }
  72.  
  73. Glib->bootstrap ($VERSION);
  74.  
  75. package Glib::Flags;
  76.  
  77. use overload
  78.    'bool' => \&bool,
  79.    '+'    => \&union,     '|'    => \&union,
  80.    '-'    => \&sub,
  81.    '>='   => \&ge,
  82.    '=='   => \&eq,        'eq'   => \&eq,
  83.    '!='   => \&ne,        'ne'   => \&ne,
  84.    '*'    => \&intersect, '&'    => \&intersect,
  85.    '/'    => \&xor,       '^'    => \&xor,
  86.    '@{}'  => \&as_arrayref,
  87.    '""'   => sub { "[ @{$_[0]} ]" },
  88.    fallback => 1;
  89.  
  90. package Glib::Error;
  91.  
  92. use overload
  93.    '""' => sub { $_[0]->message.$_[0]->location },
  94.    fallback => 1;
  95.  
  96. sub location { $_[0]->{location} }
  97. sub message { $_[0]->{message} }
  98. sub domain { $_[0]->{domain} }
  99. sub value { $_[0]->{value} }
  100. sub code { $_[0]->{code} }
  101.  
  102. package Glib::Object::Property;
  103.  
  104. use Carp;
  105.  
  106. sub TIESCALAR
  107. {
  108. # in the array reference the elements are:
  109. #    [0] Glib::Object
  110. #    [1] property name
  111.  
  112.     bless [ $_[1], $_[2] ], $_[0];
  113. }
  114.  
  115. sub STORE { croak 'property '.$_[0][1].' is read-only'; }
  116.  
  117. sub FETCH { '[write-only]'; }
  118.  
  119. package Glib::Object::Property::Readable;
  120.  
  121. our @ISA = qw/Glib::Object::Property/;
  122.  
  123. sub FETCH { $_[0][0]->get_property ($_[0][1]); }
  124.  
  125. package Glib::Object::Property::Writable;
  126.  
  127. our @ISA = qw/Glib::Object::Property/;
  128.  
  129. sub STORE { $_[0][0]->set_property ($_[0][1], $_[1]); }
  130.  
  131. package Glib::Object::Property::ReadWrite;
  132.  
  133. our @ISA = qw/Glib::Object::Property/;
  134.  
  135. *FETCH = \&Glib::Object::Property::Readable::FETCH;
  136. *STORE = \&Glib::Object::Property::Writable::STORE;
  137.  
  138. package Glib::Object;
  139.  
  140. use Carp;
  141.  
  142. sub tie_properties
  143. {
  144.     my $self = shift;    # the object
  145.     my $all = shift;    # add all properties, up heirarchy
  146.  
  147.     my @props = $self->list_properties;
  148.     my $package = ref $self;
  149.     my $name;
  150.     foreach my $prop (@props)
  151.     {
  152.         # skip to next if it doesn't belong to this package and
  153.         # they don't want everything tied
  154.         next if ($prop->{owner_type} ne $package and not $all);
  155.  
  156.         $name = $prop->{name};
  157.         $name =~ s/-/_/g;
  158.  
  159.         carp "overwriting existing non-tied hash key $name"
  160.             if (exists ($self->{$name})
  161.                 and not tied $self->{$name});
  162.  
  163.         if ($prop->{flags} >= ["readable", "writable"]) {
  164.                         tie $self->{$name},
  165.                                 'Glib::Object::Property::ReadWrite',
  166.                                 $self, $name;
  167.                 } elsif ($prop->{flags} >= "readable") {
  168.                         tie $self->{$name},
  169.                                 'Glib::Object::Property::Readable',
  170.                                 $self, $name;
  171.                 } elsif ($prop->{flags} >= "writable") {
  172.             tie $self->{$name},
  173.                 'Glib::Object::Property::Writable',
  174.                 $self, $name;
  175.                 } else {
  176.                         # if it's not readable and not writable what is it?
  177.         }
  178.     }
  179. }
  180.  
  181. package Glib::Object::_LazyLoader;
  182.  
  183. use strict;
  184. no strict qw(refs);
  185. use vars qw($AUTOLOAD);
  186. push @Carp::CARP_NOT, __PACKAGE__;
  187.  
  188. # These two overrides won't keep explicit calls to UNIVERSAL::(isa|can)
  189. # from breaking if called before anything is loaded, but those should
  190. # be quite rare.
  191.  
  192. sub isa {
  193.     # we really shouldn't get in here at all if $_[0] is undefined.
  194.     _load (ref($_[0]) || $_[0]);
  195.     $_[0]->SUPER::isa ($_[1]);
  196. }
  197.  
  198. sub can {
  199.     # we really shouldn't get in here at all if $_[0] is undefined.
  200.     _load (ref($_[0]) || $_[0]);
  201.     $_[0]->SUPER::can ($_[1]);
  202. }
  203.  
  204. sub AUTOLOAD {
  205.     (my $method = $AUTOLOAD) =~ s/^.*:://;
  206.     (my $lazy_class = $AUTOLOAD) =~ s/::[^:]*$//;
  207.     my $object_or_type = shift;
  208.  
  209.     _load ($lazy_class);
  210.  
  211.     die "Something is very broken, couldn't lazy load $lazy_class"
  212.         if $object_or_type->isa (__PACKAGE__);
  213.  
  214.     # try again
  215.     return $object_or_type->$method (@_);
  216. }
  217.  
  218. package Glib;
  219.  
  220. 1;
  221. __END__
  222.  
  223. =head1 NAME
  224.  
  225. Glib - Perl wrappers for the GLib utility and Object libraries
  226.  
  227. =head1 SYNOPSIS
  228.  
  229.   use Glib;
  230.  
  231. =head1 ABSTRACT
  232.  
  233. This module provides perl access to GLib and GLib's GObject libraries.
  234. GLib is a portability and utility library; GObject provides a generic
  235. type system with inheritance and a powerful signal system.  Together
  236. these libraries are used as the foundation for many of the libraries
  237. that make up the Gnome environment, and are used in many unrelated
  238. projects.
  239.  
  240. =head1 DESCRIPTION
  241.  
  242. This wrapper attempts to provide a perlish interface while remaining
  243. as true as possible to the underlying C API, so that any reference
  244. materials you can find on using GLib may still apply to using the
  245. libraries from perl.  This module also provides facilities for creating
  246. wrappers for other GObject-based libraries.  The L<SEE ALSO> section
  247. contains pointers to all sorts of good information.
  248.  
  249. =head1 PERL VERSUS C
  250.  
  251. GLib provides to C programs many of the same facilities Perl offers
  252. natively.  Where GLib's functionality overlaps Perl's, Perl's is favored.
  253. Some concepts have been eliminated entirely, as Perl is a higher-level
  254. language than C.  In other instances we've had to add or change APIs to
  255. make sense in Perl.  Here's a quick run-down:
  256.  
  257. =head2 Perl Already Does That
  258.  
  259. The GLib types GList (a doubly-linked list), GSList (singly-linked list),
  260. GHashTable, GArray, etc have all been replaced by native Perl datatypes.  In
  261. fact, many functions which take GLists or arrays simply accept lists on the
  262. Perl stack.  For the most part, GIOChannels are no more functional than Perl
  263. file handles, so you won't see any GIOChannels.  GClosures are not visible at
  264. the Perl level, because Perl code references do the same thing.  Just about any
  265. function taking either a C function pointer or a GClosure will accept a code
  266. reference in Perl.  (In fact, you can probably get away with just a subroutine
  267. name in many spots, provided you aren't using strict subs.)
  268.  
  269. =head2 Don't Worry About That
  270.  
  271. Some concepts have been eliminated; you need never worry about
  272. reference-counting on GObjects or having to free GBoxed structures.  Perl is a
  273. garbage-collected language, and we've put a lot of work into making the
  274. bindings take care of memory for you in a way that feels natural to a Perl
  275. developer.  You won't see GValues in Perl (that's just a C structure with Perl
  276. scalar envy, anyway).
  277.  
  278. =head2 This Is Now That
  279.  
  280. Other GLib concepts have been converted to an analogous Perl concept.
  281.  
  282. The GType id will never be seen in Perl, as the package name serves that
  283. purpose.  Several packages corresponding to the GTypes of the fundamental types
  284. have been registered for you:
  285.  
  286.  G_TYPE_STRING     Glib::String
  287.  G_TYPE_INT        Glib::Int
  288.  G_TYPE_UINT       Glib::UInt
  289.  G_TYPE_DOUBLE     Glib::Double
  290.  G_TYPE_BOOLEAN    Glib::Boolean
  291.  
  292. The remaining fundamentals (char/uchar, short, float, etc) are also registered
  293. so that we can properly interact with properties of C objects, but perl really
  294. only uses ints, uints, and doubles.  Oh, and we created a GBoxed type for Perl
  295. scalars so you can use scalars where any boxed type would be allowed (e.g.
  296. GtkTreeModel columns):
  297.  
  298.  Glib::Scalar
  299.  
  300. Functions that can return false and set a GError in C raise an exception in
  301. Perl, using an exception object based on the GError for $@; see L<Glib::Error>.
  302. Trapping exceptions in signals is a sticky issue, so they get their own
  303. section; see L<EXCEPTIONS>.
  304.  
  305. Enumerations and flags are treated as strings and arrays of strings,
  306. respectively.  GLib provides a way to register nicknames for enumeration
  307. values, and the Perl bindings use these nicknames for the real values, so that
  308. we never have to deal with numbers in Perl. This can get a little cumbersome
  309. for bitfields, but it's very nice when you forget a flag value, as the bindings
  310. will tell you what values are accepted when you pass something invalid. Also,
  311. the bindings consider the - and _ characters to be equivalent, so that signal
  312. and property names can be properly stringified by the => operator.  For
  313. example, the following are equivalent:
  314.  
  315.   # property foo-matic of type FooType, using the
  316.   # value FOO_SOMETHING_COOL.  its nickname would be
  317.   # 'something-cool'.  you may use either the full
  318.   # name or the nickname when supplying values to perl.
  319.   $object->set ('foo-matic', 'FOO_SOMETHING_COOL');
  320.   $object->set ('foo_matic', 'something_cool');
  321.   $object->set (foo_matic => 'something-cool');
  322.  
  323. Beware that Perl will always return to you the nickname form, with the dash.
  324.  
  325. Flags have some additional magic abilities in the form of overloaded
  326. operators:
  327.  
  328.   + or |   union of two flagsets ("add")
  329.   -        difference of two flagsets ("sub", "remove")
  330.   * or &   intersection of two bitsets ("and")
  331.   / or ^   symmetric difference ("xor", you will rarely need this)
  332.   >=       contains-operator ("is the left set a superset of the right set?")
  333.   ==       equality
  334.  
  335. In addition, flags in boolean context indicate whether they are empty or
  336. not, which allows you to write common operations naturally:
  337.  
  338.   $widget->set_events ($widget->get_events - "motion_notify_mask");
  339.   $widget->set_events ($widget->get_events - ["motion_notify_mask",
  340.                                               "button_press_mask"]);
  341.  
  342.   # shift pressed (both work, it's a matter of taste)
  343.   if ($event->state >= "shift-mask") { ...
  344.   if ($event->state * "shift-mask") { ...
  345.  
  346.   # either shift OR control pressed?
  347.   if ($event->state * ["shift-mask", "control-mask"]) { ...
  348.  
  349.   # both shift AND control pressed?
  350.   if ($event->state >= ["shift-mask", "control-mask"]) { ...
  351.  
  352. In general, C<+> and C<-> work as expected to add or remove flags. To test
  353. whether I<any> bits are set in a mask, you use C<$mask * ...>, and to test
  354. whether I<all> bits are set in a mask, you use C<< $mask >= ... >>.
  355.  
  356. When dereferenced as an array C<@$flags> or C<< $flags->[...] >>, you can
  357. access the flag values directly as strings (but you are not allowed to
  358. modify the array), and when stringified C<"$flags"> a flags value will
  359. output a human-readable version of its contents.
  360.  
  361. =head2 It's All the Same
  362.  
  363. For the most part, the remaining bits of GLib are unchanged.  GMainLoop is now
  364. Glib::MainLoop, GObject is now Glib::Object, GBoxed is now Glib::Boxed, etc.
  365.  
  366. =head1 FILENAMES, URIS AND ENCODINGS
  367.  
  368. Perl knows two datatypes, unicode text and binary bytes. Filenames on
  369. a system that doesn't use a utf-8 locale are often stored in a local
  370. encoding ("binary bytes"). Gtk+ and descendants, however, internally
  371. work in unicode most of the time, so when feeding a filename into a
  372. GLib/Gtk+ function that expects a filename, you first need to convert it
  373. from the local encoding to unicode.
  374.  
  375. This involves some elaborate guessing, which perl currently avoids, but
  376. GLib and Gtk+ do. As an exception, some Gtk+ functions want a filename
  377. in local encoding, but the perl interface usually works around this by
  378. automatically converting it for you.
  379.  
  380. In short: Everything should be in unicode on the perl level.
  381.  
  382. The following functions expose the conversion algorithm that GLib uses.
  383.  
  384. These functions are only necessary when you want to use perl functions
  385. to manage filenames returned by a GLib/Gtk+ function, or when you feed
  386. filenames into GLib/Gtk+ functions that have their source outside your
  387. program (e.g. commandline arguments, readdir results etc.).
  388.  
  389. These functions are available as exports by request (see L</Exports>),
  390. and also support method invocation syntax for pathological consistency
  391. with the OO syntax of the rest of the bindings.
  392.  
  393. =over 4
  394.  
  395. =item $filename = filename_to_unicode $filename_in_local_encoding
  396.  
  397. =item $filename = Glib->filename_to_unicode ($filename_in_local_encoding)
  398.  
  399. Convert a perl string that supposedly contains a filename in local
  400. encoding into a filename represented as unicode, the same way that GLib
  401. does it internally.
  402.  
  403. Example:
  404.  
  405.    $gtkfilesel->set_filename (filename_to_unicode $ARGV[1]);
  406.  
  407. This function will croak() if the conversion cannot be made, e.g., because the
  408. utf-8 is invalid.
  409.  
  410. =item $filename_in_local_encoding = filename_from_unicode $filename
  411.  
  412. =item $filename_in_local_encoding = Glib->filename_from_unicode ($filename)
  413.  
  414. Converts a perl string containing a filename into a filename in the local
  415. encoding in the same way GLib does it.
  416.  
  417. Example:
  418.  
  419.    open MY, "<", filename_from_unicode $gtkfilesel->get_filename;
  420.  
  421. =back
  422.  
  423. It might
  424. be useful to know that perl currently has no policy at all regarding
  425. filename issues, if your scalar happens to be in utf-8 internally it will
  426. use utf-8, if it happens to be stored as bytes, it will use it as-is.
  427.  
  428. When dealing with filenames that you need to display, there is a much easier
  429. way, as of Glib 1.120 and glib 2.6.0:
  430.  
  431. =over 4
  432.  
  433. =item $uft8_string = filename_display_name ($filename)
  434.  
  435. =item $uft8_string = filename_display_basename ($filename)
  436.  
  437. Given a I<$filename> in filename encoding, return the filename, or just
  438. the file's basename, in utf-8.  Unlike the other functions described above,
  439. this one is guaranteed to return valid utf-8, but the conversion is not
  440. necessarily reversible.  These functions are intended to be used for failsafe
  441. display of filenames, for example in gtk+ labels.
  442.  
  443. Since glib 2.6, Glib 1.12
  444.  
  445. =back
  446.  
  447. The following convert filenames to and from URI encoding.  (See also
  448. L<URI::file>.)
  449.  
  450. =over 4
  451.  
  452. =item $string = filename_to_uri ($filename, $hostname)
  453.  
  454. =item $string = Glib->filename_to_uri ($filename, $hostname)
  455.  
  456. Return a "file://" schema URI for a filename.  Unsafe and non-ascii chars in
  457. C<$filename> are escaped with URI "%" forms.
  458.  
  459. C<$filename> must be an absolute path as a byte string in local filesystem
  460. encoding.  C<$hostname> is a utf-8 string, or empty or C<undef> for no host
  461. specified.  For example,
  462.  
  463.     filename_to_uri ('/my/x%y/<dir>/foo.html', undef);
  464.     # returns 'file:///my/x%25y/%3Cdir%3E/foo.html'
  465.  
  466. If C<$filename> is a relative path or C<$hostname> doesn't look like a
  467. hostname then C<filename_to_uri> croaks with a C<Glib::Error>.
  468.  
  469. When using the class style C<< Glib->filename_to_uri >> remember that the
  470. C<$hostname> argument is mandatory.  If you forget then it looks like a
  471. 2-argument call with filename of "Glib" and hostname of what you meant to be
  472. the filename.
  473.  
  474. =item $filename = filename_from_uri ($uri)
  475.  
  476. =item ($filename, $hostname) = filename_from_uri ($uri)
  477.  
  478. Extract the filename and hostname from a "file://" schema URI.  In scalar
  479. context just the filename is returned, in array context both filename and
  480. hostname are returned.
  481.  
  482. The filename returned is bytes in the local filesystem encoding and with the
  483. OS path separator character.  The hostname returned is utf-8.  For example,
  484.  
  485.     ($f,$h) = filename_from_uri ('file://foo.com/r%26b/bar.html');
  486.     # returns '/r&b/bar.html' and 'foo.com' on Unix
  487.  
  488. If C<$uri> is not a "file:", or is mal-formed, or the hostname part doesn't
  489. look like a host name then C<filename_from_uri> croaks with a
  490. C<Glib::Error>.
  491.  
  492. =back
  493.  
  494.  
  495. =head1 EXCEPTIONS
  496.  
  497. The C language doesn't support exceptions; GLib is a C library, and of course
  498. doesn't support exceptions either.  In Perl, we use die and eval to raise
  499. and trap exceptions as a rather common practice.  So, the bindings have to
  500. work a little black magic behind the scenes to keep GLib from exploding when
  501. the Perl program uses exceptions.  Unfortunately, a little of this magic
  502. has to leak out to where you can see it at the Perl level.
  503.  
  504. Signal and event handlers are run in an eval context; if an exception occurs
  505. in such a handler and you don't catch it, Perl will report that an error
  506. occurred, and then go on about its business like nothing happened.
  507.  
  508. You may register subroutines as exception handlers, to be called when such
  509. an exception is trapped.  Another function removes them for you.
  510.  
  511.   $tag = Glib->install_exception_handler (\&my_handler);
  512.   Glib->remove_exception_handler ($tag);
  513.  
  514. The exception handler will get a fresh copy of the $@ of the offending
  515. exception on the argument stack, and is expected to return non-zero if the
  516. handler is to remain installed.  If it returns false, the handler will be
  517. removed.
  518.  
  519.   sub my_handler {
  520.       if ($_[0] =~ m/ftang quisinart/) {
  521.            clean_up_after_ftang ();
  522.       }
  523.       1; # live to fight another day
  524.   }
  525.  
  526. You can register as many handlers as you like; they will all run
  527. independently.
  528.  
  529. An important thing to remember is that exceptions do not cross main loops.
  530. In fact, exceptions are completely distinct from main loops.  If you need
  531. to quit a main loop when an exception occurs, install a handler that quits
  532. the main loop, but also ask yourself if you are using exceptions for flow
  533. control or exception handling.
  534.  
  535. =head1 LOG MESSAGES
  536.  
  537. GLib's g_log function provides a flexible mechanism for reporting messages,
  538. and most GLib-based C libraries use this mechanism for warnings, assertions,
  539. critical messages, etc.  The Perl bindings offer a mechanism for routing
  540. these messages through Perl's native system, warn() and die().  Extensions
  541. should register the log domains they wrap for this to happen fluidly.
  542. [FIXME say more here]
  543.  
  544. =head1 64 BIT INTEGERS
  545.  
  546. Since perl's integer data type can only hold 32 bit values on all 32 bit
  547. machines and even on some 64 bit machines, Glib converts 64 bit integers to and
  548. from strings if necessary.  These strings can then be used to feed one of the
  549. various big integer modules.  Make sure you don't let your strings get into
  550. numerical context before passing them into a Glib function because in this
  551. case, perl will convert the number to scientific notation which at this point
  552. is not understood by Glib's converters.
  553.  
  554. Here is an overview of what big integer modules are available.  First of all,
  555. there's Math::BigInt.  It has everything you will ever need, but its pure-Perl
  556. implementation is also rather slow.  There are multiple ways around this,
  557. though.
  558.  
  559. =over
  560.  
  561. =item L<Math::BigInt::FastCalc>
  562.  
  563. L<Math::BigInt::FastCalc> can help avoid the glacial speed of vanilla
  564. L<Math::BigInt::Calc>.  Recent versions of L<Math::BigInt> will automatically
  565. use L<Math::BigInt::FastCalc> in place of L<Math::BigInt::Calc> when available.
  566. Other options include L<Math::BigInt::GMP> or L<Math::BigInt::Pari>, which
  567. however have much larger dependencies.
  568.  
  569. =item L<Math::BigInt::Lite>
  570.  
  571. Then there's L<Math::BigInt::Lite>, which uses native Perl integer operations
  572. as long as Perl integers have sufficient range, and upgrades itself to
  573. L<Math::BigInt> when Perl integers would overflow. This must be used in place
  574. of L<Math::BigInt>.
  575.  
  576. =item L<bigint> / L<bignum> / L<bigfloat>
  577.  
  578. Finally, there's the bigint/bignum/bigfloat pragmata, which automatically load
  579. the corresponding Math:: modules and which will autobox constants.
  580. bignum/bigint will automatically use L<Math::BigInt::Lite> if it's available.
  581.  
  582. =back
  583.  
  584. =head1 EXPORTS
  585.  
  586. For the most part, gtk2-perl avoids exporting things.  Nothing is exported by
  587. default, but some functions and constants in Glib are available by request;
  588. you can also get all of them with the export tag "all".
  589.  
  590. =over
  591.  
  592. =item Tag: constants
  593.  
  594.   TRUE
  595.   FALSE
  596.   G_PRIORITY_HIGH
  597.   G_PRIORITY_DEFAULT
  598.   G_PRIORITY_HIGH_IDLE
  599.   G_PRIORITY_DEFAULT_IDLE
  600.   G_PRIORITY_LOW
  601.   G_PARAM_READWRITE
  602.  
  603. =item Tag: functions
  604.  
  605.   filename_from_unicode
  606.   filename_to_unicode
  607.   filename_from_uri
  608.   filename_to_uri
  609.   filename_display_basename
  610.   filename_display_name
  611.  
  612. =back
  613.  
  614. =head1 SEE ALSO
  615.  
  616. L<Glib::Object::Subclass> explains how to create your own gobject subclasses
  617. in Perl.
  618.  
  619. L<Glib::index> lists the automatically-generated API reference for the
  620. various packages in Glib.
  621.  
  622. This module is the basis for the Gtk2 module, so most of the references
  623. you'll be able to find about this one are tied to that one.  The perl
  624. interface aims to be very simply related to the C API, so see the C API
  625. reference documentation:
  626.  
  627.   GLib - http://developer.gnome.org/doc/API/2.0/glib/
  628.   GObject - http://developer.gnome.org/doc/API/2.0/gobject/
  629.  
  630. This module serves as the foundation for any module which needs to bind
  631. GLib-based C libraries to perl.
  632.  
  633.   Glib::devel - Binding developer's overview of Glib's internals
  634.   Glib::xsapi - internal API reference for GPerl
  635.   Glib::ParseXSDoc - extract API docs from xs sources.
  636.   Glib::GenPod - turn the output of Glib::ParseXSDoc into POD
  637.   Glib::MakeHelper - Makefile.PL utilities for Glib-based extensions
  638.  
  639.   Yet another document, available separately, ties it all together:
  640.     http://gtk2-perl.sourceforge.net/doc/binding_howto.pod.html
  641.  
  642. For gtk2-perl itself, see its website at
  643.  
  644.   gtk2-perl - http://gtk2-perl.sourceforge.net/
  645.  
  646. A mailing list exists for discussion of using gtk2-perl and related
  647. modules.  Archives and subscription information are available at
  648. http://lists.gnome.org/.
  649.  
  650.  
  651. =head1 AUTHORS
  652.  
  653. =encoding utf8
  654.  
  655. muppet, E<lt>scott at asofyet dot orgE<gt>, who borrowed heavily from the work
  656. of G├╢ran Thyni, E<lt>gthyni at kirra dot netE<gt> and Guillaume Cottenceau
  657. E<lt>gc at mandrakesoft dot comE<gt> on the first gtk2-perl module, and from
  658. the sourcecode of the original gtk-perl and pygtk projects.  Marc Lehmann
  659. E<lt>pcg at goof dot comE<gt> did lots of great work on the magic of making
  660. Glib::Object wrapper and subclassing work like they should.  Ross McFarland
  661. <rwmcfa1 at neces dot com> wrote quite a bit of the documentation generation
  662. tools.  Torsten Schoenfeld <kaffeetisch at web dot de> contributed little
  663. patches and tests here and there.
  664.  
  665. =head1 COPYRIGHT AND LICENSE
  666.  
  667. Copyright 2003-2009 by muppet and the gtk2-perl team
  668.  
  669. This library is free software; you can redistribute it and/or modify
  670. it under the terms of the Lesser General Public License (LGPL).  For
  671. more information, see http://www.fsf.org/licenses/lgpl.txt
  672.  
  673. =cut
  674.